package observer.advanced;

/**
 * 看股票的同事
 * @author Chen Guang
 * @date 2019/4/9 0009 下午 16:17
 */
public class StockObserver{

    private Subject subject;
    private String name;

    public StockObserver(Subject subject, String name) {
        this.subject = subject;
        this.name = name;
        System.out.println(name + "这股市总是起起伏伏伏伏伏伏伏伏伏伏伏伏伏伏伏伏伏伏，哈哈哈，nmsl！");
    }

    public void closeStockMarket() {
        System.out.println(name + " " + subject.getSubjectState() + " 关闭股票行情，继续工作!");
    }
}
